home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Mac Game Programming Gurus
/
TricksOfTheMacGameProgrammingGurus.iso
/
Book Chapters
/
03 - Advanced Graphics
/
Example 4 - Encoder
/
main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-25
|
1KB
|
86 lines
//
// File: main.c
//
// This file contains the code for a simple shape encoder.
// It will encode all the picts in the resource fork as shapes and exit.
//
// 2/25/95 -- Created by Mick
//
// include files
#include "global.h"
#include "main.h"
#include "encoder.h"
// defines for this file
// global function declarations
void main( void );
// global data owned by this file
CTabHandle gAppColorTable; // the color table that we are drawing with
// local function declarations
static void initMacToolboxes( void );
// static data
// functions
//
// main -
// This is where it all begins.
//
void main( void )
{
// fire up the toolboxes
initMacToolboxes();
// get the color table
gAppColorTable = GetCTable( kAppColorTableResID );
// give the encoding code a chance to setup
startupEncoder();
// handle events until the user signals a quit
doEncode();
// give the encoding a chance to shutdown
shutdownEncoder();
}
//
// initMacToolboxes -
// Initialize all the toolboxes that we will need.
//
void initMacToolboxes( void )
{
// initialize all the toolboxes
InitGraf( &( qd.thePort ) );
InitFonts();
InitWindows();
InitMenus();
TEInit();
InitDialogs( ( ProcPtr )kNil );
InitCursor();
// make sure that we have the enitre heap
MaxApplZone();
// allocate some extra master pointers
MoreMasters();
MoreMasters();
MoreMasters();
MoreMasters();
// set the random seed
qd.randSeed = TickCount();
}